<%@page import="java.net.URLDecoder"%>
<%@page import="java.net.URLEncoder"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript">
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}
				function Validate()
				  {
					 
					 var cat_name=document.getElementById("txtname").value;
					 if(trim(cat_name)==""){
						 alert("Please enter category name");
						 document.getElementById("txtname").focus();
						 return false;
					 }
				 }	
				
</script>
</head>
<body>
<form method="post" action="update_category.html" onsubmit="return Validate();">
<table cellpadding="0" cellspacing="0" width="730" align="center" border="0" class="newsTitle">	
	<tr><td colspan="2" height="10"> </td></tr>	
	<tr align="center"><td colspan="2" height="30" style="font-size:14px;"><u>កែប្រែប្រភេទឯកសារ</u></td></tr>
	<tr><td colspan="2" height="10"> </td></tr>
	<c:forEach var="i" begin="0" end="${fn:length(Category)-1}">
	<tr>
		<td height="30" width="30%" align="right">* ឈ្មោះ :&nbsp;</td>	
		<td align="left"><input type="text" id="txtname" name="txtname" value="${Category[i].CATEGORY_NAME}" maxlength="500" style="width: 400px;height:25px;"/></td>
	</tr>
	<tr><td colspan="2" height="3"><input type="hidden" name="txtid" id="txtid" value="${Category[i].CATEGORY_ID}"></td></tr>
	</c:forEach>
	<tr>
		<td height="5"></td>
		<td height="5" align="left" style="font-size: 10px;">* តំរូវអោយបញ្ចូល</td>
	</tr>
	<tr><td colspan="2" height="10"> </td></tr>
	<tr>
		<td colspan="2" align="center" height="30"><input type="submit" class="input_button" value="រក្សាទុក">&nbsp;&nbsp;<input type="button"​ class="input_button" onclick='window.location="category_list.html"' value="ចាកចេញ"></td>
	</tr>
	<tr><td colspan="2" height="25">&nbsp;</td></tr>
</table>
</form>
</body>
</html>